<?php
/*
	
*/
defined('BY_JYA') or exit('Access Denied');
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
if($_RQ['op']=='main'){
	$return['params']=array('jy'=>1);
	set_html('title','我的蛋鸡');
	exi($return);
}
if($_RQ['op']=='list'){
	$params=array('uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['youmid']?:$_SESSION['uid']);
	$pindex = max(1, intval($_RQ['page']));
	$psize = 10;
	$total='';
	$list=pdo_getslice('jy_nongren_myji',$params,array($pindex,$psize),$total,$fields,'','id asc');
	if($list){
		$daytime = mktime(0,0,0,date('m'),date('d'),date('Y'));
		$dj_allday=$this->setting['dj_allday']?:120;
		foreach($list as &$item){
			$item['isweiji']=$item['weitime']>$daytime?1:0;
			$item['weitime']=date('Y-m-d H:i:s',$item['weitime']);
			$item['statustitle']=$this->myji_status[$item['status']];
			$item['lastday']=$dj_allday-$item['lsday'];
			$item['lastday']=$item['lastday']>0?$item['lastday']:0;
			$item['steptitle']=$this->myji_step[$item['step']];
		}
	}
	$return['list']=$list;
	exi($return);
}
